package com.ap.generator.submitrtp;

import static com.ap.datagen.core.GeneratorHelper.buildA;
import static com.ap.datagen.core.Nullable.nullable;
import static com.ap.generator.common.DeliveryInfoTypeGeneratorBuilder.getDeliveryInfoTypeGenerator;
import static com.ap.generator.messageheader.SubmitRTPMsgHdrTypeGeneratorBuilder.msgHdrTypeGenerator;
import static com.ap.generator.requestorigination.RequestOriginationTypeGeneratorBuilder.requestOriginationGenerator;
import static com.ap.generator.rtp.RTPSenderInfoTypeGeneratorBuilder.getRTPSenderInfoTypeGenerator;

import com.ap.core.cxf.jaxb.managertp.AbstractSubmitRTP1RequestGeneratorBuilder;
import com.ap.core.cxf.jaxb.managertp.SubmitRTPMessageType;
import com.ap.core.cxf.jaxb.rtp.TransactionCheckOutType;
import com.ap.generator.common.FieldGenerator;
import com.ap.generator.rtp.RTPDetailTypeGeneratorBuilder;
import com.ap.generator.rtp.RTPSummaryTypeGeneratorBuilder;


/**
 * 
 *
 */
public class SubmitRTPTypeInfoGeneratorBuilder extends AbstractSubmitRTP1RequestGeneratorBuilder {
	
    @Override
    public void setupDefaults() {
    	this.msgHdrGenerator = FieldGenerator.MSGHDRGENERATORSUBMITRTP;
		this.requestOriginationGenerator = nullable(buildA(requestOriginationGenerator()));
		this.RTPSenderInfoGenerator = nullable(buildA(getRTPSenderInfoTypeGenerator()));
		this.deliveryGenerator = nullable(buildA(getDeliveryInfoTypeGenerator()));
		this.RTPSummaryGenerator = nullable(buildA(RTPSummaryTypeGeneratorBuilder
				.getRTPSummaryTypeGenerator()));
		this.RTPDetailGenerator = nullable(buildA(RTPDetailTypeGeneratorBuilder
				.getRTPDetailTypeGenerator()));
        
    }
    
    /**
     * 
     * @return
     */
    public static SubmitRTPTypeInfoGeneratorBuilder getSubmitRTPTypeGenerator() {
    	return new SubmitRTPTypeInfoGeneratorBuilder();
    }
    
    public SubmitRTPTypeInfoGeneratorBuilder getSubmitRTPType(SubmitRTPMessageType inputMsgType){
    	this.msgHdrGenerator = nullable(buildA(msgHdrTypeGenerator().withMsgType(inputMsgType)));
    	return this;
    }
    
    public SubmitRTPTypeInfoGeneratorBuilder getSubmitRTPType(TransactionCheckOutType txCheckoutType){
    	this.RTPSummaryGenerator = nullable(buildA(RTPSummaryTypeGeneratorBuilder.getRTPSummaryTypeGenerator().getRTPSummaryType(txCheckoutType)));
    	return this;
    	
    }
    
    
}
